package com.ztgf.search.models.service;

import com.ztgf.search.models.bean.SearchRequestBean;
import com.ztgf.search.models.bean.SearchResponseBean;
import com.ztgf.search.models.dto.EsShopDTO;

import java.util.List;

/*
 * 店铺搜索服务
 * */
public interface IShopSearchService {
    /**
     * @Description: 搜索店铺
     * @Author: chenyu.wang
     * @Params: [aliasName, type, searchFields, searchRequestBean]
     * @Date: 2020.12.22 10:26
     */
    SearchResponseBean searchShop(String aliasName, String type, String searchFields, SearchRequestBean searchRequestBean);

    /**
     * @Description: 添加所有店铺到ES
     * @Author: chenyu.wang
     * @Params: []
     * @Date: 2020.12.22 10:27
     */
    boolean add();

    /**
     * @Description: 更新es店铺信息
     * @Author: chenyu.wang
     * @Params: [aliasName, typeName, begin, end, totalList]
     * @Date: 2020.12.22 10:27
     */
    void addShop(String aliasName, String typeName, int begin, int end, List<EsShopDTO> totalList);

    /**
     * @Description: 删除es店铺信息
     * @Author: chenyu.wang
     * @Params: [aliasName, typeName, id]
     * @Date: 2020.12.22 10:27
     */
    void deleteData(String aliasName, String typeName, String id);

    /**
     * @Description: 判断店铺索引是否存在
     * @Author: chenyu.wang
     * @Params: [indexName]
     * @Date: 2020.12.22 10:28
     */
    boolean checkIndex(String indexName);

    /**
     * @Description: 更新es店铺信息
     * @Author: chenyu.wang
     * @Params: [id, aliasName, typeName, begin, end, totalList]
     * @Date: 2020.12.30 18:05
     */
    void updateShop(String id, String aliasName, String type, int begin, int end, List<EsShopDTO> totalList);
}
